
package physiqueEngine.formes;

import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;

public class Physic
{
    public static void applyCollision()
    {
                
    }
    
    public static Line2D.Double getNormal(PhysBody bodyA, PhysBody bodyB)
    {
        return new Line2D.Double(bodyA.LOC.x, bodyA.LOC.y, bodyB.LOC.x, bodyB.LOC.y);
    }

    public static void collision(ArrayList<PhysBody> list)
    {
        PhysBody tempI = null;
        PhysBody tempJ = null;
        
        for (int i = 0; i < list.size(); i++)
        {
            tempI = list.get(i);
            for (int j = i + 1; j < list.size(); j++)
            {
                tempJ = list.get(j);
                
                tempI.resolveCollision(tempJ);

                //if (tempI.intersects(tempJ.getBounds()))
                //{
                //    Physic.impactForce(list.get(j), list.get(i));
                //    list.get(i).setSpeed(0, 0);
                //    list.get(j).setSpeed(0, 0);
                //}
            }
        }
    }
}
